package br.com.controller;

import java.util.List;
import java.util.Scanner;

import br.com.robot.RobotBean;
import br.com.robot.RobotController;
import br.com.robot.RobotList;
import br.com.robot.implement.AbstractRobot;

public class Executor
{
	public static void main( String[] args ) 
	{
		List<RobotBean<? extends AbstractRobot>> container = RobotList.getContainer( );
		
		for( RobotBean<? extends AbstractRobot> robotBean : container )
		{
			System.out.println( robotBean.getId( ) + " - " + robotBean.getNome( ) );
		}
		
		System.out.print( "Digite o id a executar: " );
		
		Scanner sc = new Scanner( System.in );
		
		int val = sc.nextInt( );
		
		RobotBean<? extends AbstractRobot> bean = RobotList.getBean( val );
		
		RobotController.infController( ).executa( bean.getTipo( ) );
		
		sc.close( );
	}
}